package Java8实战._1_LocalDate_LocalTime_Instant_Duration_Period._1_LocalData_LocalTime;

import java.time.LocalDate;
import java.time.temporal.ChronoField;

public class _2_使用TemporalField读取LocalDate的值 {
    public static void main(String[] args) {
        LocalDate localDate = LocalDate.now();

        int year = localDate.get(ChronoField.YEAR);
        System.out.println("year : " + year);

        int month = localDate.get(ChronoField.MONTH_OF_YEAR);
        System.out.println("month : " + month);

        int day = localDate.get(ChronoField.DAY_OF_MONTH);;
        System.out.println("day : " + day);
    }
}
